import 'package:gold/generated/json/base/json_field.dart';
import 'dart:convert';

import 'package:gold/generated/json/user_list_model.g.dart';
import 'package:gold/model/user_model.dart';

@JsonSerializable()
class UserListModel {
	List<SearchUserModel>? data;
	int? total;
	int? count;
	@JSONField(name: 'per_page')
	int? perPage;
	@JSONField(name: 'current_page')
	int? currentPage;
	@JSONField(name: 'total_pages')
	int? totalPages;

	UserListModel();

	factory UserListModel.fromJson(Map<String, dynamic> json) => $UserListModelFromJson(json);

	Map<String, dynamic> toJson() => $UserListModelToJson(this);

	@override
	String toString() {
		return jsonEncode(this);
	}
}

@JsonSerializable()
class SearchUserModel {
	int? uid;
	String? nickname;
	String? avatar;
	UserInfo? user;

	SearchUserModel();

	factory SearchUserModel.fromJson(Map<String, dynamic> json) => $SearchUserModelFromJson(json);

	Map<String, dynamic> toJson() => $SearchUserModelToJson(this);

	@override
	String toString() {
		return jsonEncode(this);
	}
}